using System;
using System.Text;
using System.Collections.Generic;


namespace ServerFramework.Implementation.Database.Domain {
    
    public class Handler_T {
        public virtual int ServerType { get; set; }
        public virtual int? Handlertype { get; set; }
        public virtual int? Operation { get; set; }
        public virtual int? Suboperation { get; set; }
        public virtual int? Serverhandler { get; set; }
        public virtual int? Clienthandler { get; set; }

        #region NHibernate Composite Key Requirements
        public override bool Equals(object obj)
        {
            if (obj == null) return false;
            var t = obj as Handler_T;
            if (t == null) return false;
            if (ServerType == t.ServerType
             && Handlertype == t.Handlertype
             && Operation == t.Operation
             && Suboperation == t.Suboperation
             && Serverhandler == t.Serverhandler
             && Clienthandler == t.Clienthandler)
                return true;

            return false;
        }
        public override int GetHashCode()
        {
            int hash = GetType().GetHashCode();
            hash = (hash * 397) ^ ServerType.GetHashCode();
            hash = (hash * 397) ^ Handlertype.GetHashCode();
            hash = (hash * 397) ^ Operation.GetHashCode();
            hash = (hash * 397) ^ Suboperation.GetHashCode();
            hash = (hash * 397) ^ Serverhandler.GetHashCode();
            hash = (hash * 397) ^ Clienthandler.GetHashCode();

            return hash;
        }
        #endregion
    }
}
